<?php
    Zend_Loader::loadClass("Zend_Json_Encoder");
    $recs = array();
    $i = 0;
    foreach($this->trade_record as $rec)
    {
        $recs[$i]['id'] = $rec->id;
        $recs[$i]['custid'] = $rec->custid;
        $recs[$i]['createddate'] = $rec->createddate;
        $recs[$i]['createdtime'] = $rec->createdtime;
        $i = $i + 1;
    }
    echo '{rows:'.Zend_Json_Encoder::encode($recs).'}';
?>